package com.lm.easy.rule;

import org.jeasy.rules.annotation.Action;
import org.jeasy.rules.annotation.Condition;
import org.jeasy.rules.annotation.Fact;
import org.jeasy.rules.annotation.Rule;

@Rule(name = "AgeRule", description = "Check if user's age > 18")
public class AgeRule {

    @Condition
    public boolean isAdult(@Fact("age") int age) {
        return age >= 18;
    }

    @Action
    public void grantAccess() {
        System.out.println("用户已成年，可以进入系统 ✅");
    }
}